package com.tvunetworks.center.user.model.vo;

import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang.StringUtils;

import java.util.Objects;

/**
 * @program: tvucc-aggregator
 * @description: UserIdWithEmail
 * @author lebronchen
 * @create: 2019-06-12 17:48
 **/
@Data
@Accessors(chain = true)
public class UserIdWithEmail {

    private String userId;
    private String email;

    /**
     *
     * @param o o
     * @return boolean
     */
    @Override
    public boolean equals(Object o){
        if (o instanceof UserIdWithEmail) {
            UserIdWithEmail o2 = (UserIdWithEmail)o;
            return StringUtils.equals(this.getUserId(), o2.getUserId());
        }
        return false;
    }

    @Override
    public int hashCode() {
        return Objects.hash(userId, email);
    }
}
